﻿// This file should be used if you want to debug
function jqUIInclude() {
    var pathtojsfiles = "/Scripts/jqUI/"; // need to be ajusted
    // set include to false if you do not want some modules to be included
    var modules = [
        { include: true, incfile: 'jquery.ui.core.js' },
        { include: true, incfile: 'jquery.ui.widget.js' },
        { include: true, incfile: 'jquery.ui.mouse.js' },
        { include: true, incfile: 'jquery.ui.position.js' },
        { include: true, incfile: 'jquery.ui.draggable.js' },
        { include: true, incfile: 'jquery.ui.resizable.js' },
        { include: true, incfile: 'jquery.ui.button.js' },
        { include: true, incfile: 'jquery.ui.dialog.js' },
        { include: true, incfile: 'jquery.ui.tabs.js' },
        { include: true, incfile: 'jquery.ui.datepicker.js' }
    ];
    var filename;
    for (var i = 0; i < modules.length; i++) {
        if (modules[i].include === true) {

            filename = pathtojsfiles + modules[i].incfile;
            if (jQuery.browser.safari) {
                jQuery.ajax({ url: filename, dataType: 'script', async: false, cache: true });
            } else {
                IncludeJavaScript(filename);
            }
        }
    }
    function IncludeJavaScript(jsFile) {
        var oHead = document.getElementsByTagName('head')[0];
        var oScript = document.createElement('script');
        oScript.type = 'text/javascript';
        oScript.charset = 'utf-8';
        oScript.src = jsFile;
        oHead.appendChild(oScript);
    };
};
jqUIInclude();